<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
    <title id="bv20941">ALTER USER MAPPING</title>
    <body>
        <p id="sql_command_desc">Changes the definition of a user mapping for a foreign server.</p>
        <section id="section2">
            <title>Synopsis</title>
            <codeblock id="sql_command_synopsis">ALTER USER MAPPING FOR { <varname>username</varname> | USER | CURRENT_USER | PUBLIC }
    SERVER <varname>servername</varname>
    OPTIONS ( [ ADD | SET | DROP ] <varname>option</varname> ['<varname>value</varname>'] [, ... ] )</codeblock>
        </section>
        <section id="section3">
            <title>Description</title>
            <p><codeph>ALTER USER MAPPING</codeph> changes the definition of a user mapping for a foreign server.</p>
            <p>The owner of a foreign server can alter user mappings for that server for any user. Also, a user granted <codeph>USAGE</codeph> privilege on the server can alter a user mapping for their own user name.</p>
        </section>
        <section id="section4">
            <title>Parameters</title>
            <parml>
                <plentry>
                    <pt><varname>username</varname></pt>
                    <pd>
                        <p>User name of the mapping. <codeph>CURRENT_USER</codeph> and <codeph>USER</codeph> match the name of the current user. <codeph>PUBLIC</codeph> is used to match all present and future user names in the system.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt><varname>servername</varname></pt>
                    <pd>
                        <p>Server name of the user mapping.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt>OPTIONS ( [ ADD | SET | DROP ] <varname>option</varname> ['<varname>value</varname>'] [, ... ] )</pt>
                    <pd>
                        <p>Change options for the user mapping. The new options override any previously specified options. <codeph>ADD</codeph>, <codeph>SET</codeph>, and <codeph>DROP</codeph> specify the action to perform. If no operation is explicitly specified, the default operation is <codeph>ADD</codeph>. Option names must be unique. Greenplum Database validates names and values using the server's foreign-data wrapper.</p>
                    </pd>
                </plentry>
            </parml>
        </section>
        <section id="section6">
            <title>Examples</title>
            <p>Change the password for user mapping <codeph>bob</codeph>, server <codeph>foo</codeph>:</p><codeblock>ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password 'public');</codeblock>
        </section>
        <section id="section7">
            <title>Compatibility</title>
            <p><codeph>ALTER USER MAPPING</codeph> conforms to ISO/IEC 9075-9 (SQL/MED). There is a subtle syntax issue: The standard omits the <codeph>FOR</codeph> key word. Since both <codeph>CREATE USER MAPPING</codeph> and <codeph>DROP USER MAPPING</codeph> use <codeph>FOR</codeph> in analogous positions, Greenplum Database diverges from the standard here in the interest of consistency and interoperability.</p>
        </section>
        <section id="section8">
            <title>See Also</title>
            <p><codeph><xref href="CREATE_USER_MAPPING.xml#topic1">CREATE USER MAPPING</xref></codeph>,
                        <codeph><xref href="DROP_USER_MAPPING.xml#topic1">DROP
                    USER MAPPING</xref></codeph></p>
        </section>
    </body>
</topic>
